home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / randutl.zip / RANDGEN.DOC < prev    next >
Text File  |  1997-01-13  |  16KB  |  387 lines

  1.  
  2. RANDGEN V1.2a      7/31/95
  3.  
  4. RANDGEN is a tool for RANDMAX user. If you don't know what randmax is then
  5. RANDGEN will do nothing for you (except causing headaches :-)
  6.  
  7. RANDGEN is freeware. You may upload it to any bbs or distribute it on the
  8. internet as long as it serves no commercial purpose.
  9.  
  10. RANDMAX is written by Steffen Pietsch and manages your planets :
  11. It randomizes friendly codes, taxes your natives and builds factories
  12. and mines according to an ini file.
  13.  
  14. RANDMAX and RANDGEN are utilities for VGA Planets, a multiplayer strategy game
  15. written by Tim Wisseman.
  16.  
  17. Purpose
  18. =======
  19.  
  20. I use randmax to manage all my planets.  However, it takes a lot of time to 
  21. set up a randmax.ini and it is rather annoying to change your ini whenever 
  22. you colonize or conquer a new planet.  So I thought it would be a good idea 
  23. to make a program that generates a randmax.ini for me. 
  24.  
  25. It may also be useful if you host a game and you have to make a few 
  26. caretaker turns because you are looking for a replacement player. 
  27.  
  28.  
  29. Getting started
  30. ===============
  31.  
  32. If you are familar with RANDMAX then just start RANDGEN (as parameter the 
  33. directory where your game data is).  It will update your existing 
  34. randmax.ini, i.e. it will add a 'second-section' order for all planets that 
  35. have no 'second-section' order.  The old randmax.ini will be renamed to 
  36. randmax.bak 
  37.  
  38. Please read the section "PHOST and HOST v3.2" if you play with one of these 
  39. host versions. 
  40.  
  41.  
  42. Version
  43. =======
  44. This is version v1.2a.
  45. It will work with randmax v2.d1 or later.
  46.  
  47. New in version v1.2 :
  48.  
  49. - new defaults :
  50.   MINETURNS 25 (instead of 30)
  51.   nth 40  (instead of 70)
  52.   DEFENSE 20 (instead of 0)
  53.  
  54. - "auto change" (randmax special orders are automatically updated)
  55.   related -a and -f switches
  56.  
  57. - fixed problems :
  58.  
  59.   (1) Unowned planets get a randmax.ini entry with the race characteristics
  60.       of the race that scans the planet.  Earlier randgen versions did
  61.       generate an entry that didn't take into account race-specific tax and
  62.       mining rates.
  63.  
  64.   (2) The maximum number of mines and factories on planets with valuable
  65.       natives was not correctly calculated if there were mines and factories
  66.       on the planet.  Note that there is a new method to calculate the max
  67.       factory/mine number.
  68.  
  69. New in version 1.1 :
  70.  
  71. - -d switch for maximum defense
  72.  
  73. - mnt 20/ mct 20 lines for Borg planets
  74.  
  75.  
  76. Usage
  77. =====
  78.  
  79.  randgen [DIRECTORY] [options]
  80.  
  81.  where options are
  82.  -pNN  : generate only for player NN
  83.  -n    : generate new randmax.ini (old will be renamed to randmax.bak)
  84.  -a    : disable auto change  (update of section 2 in randmax.ini)
  85.  -f    : force auto change of ALL section 2 entries in randmax.ini
  86.  -dNNN : add a defense order (dNNN) to every planet
  87.  -tNNN : taxrate NNN (default 100)
  88.  -mNNN : miningrate NNN (default 100)
  89.  -iNNN : income limit for factory maximization (default 170)
  90.  -rNNN : income limit for mine reduction (default 40)
  91.  -oNNN : time to outmine a planet (default 30) [default 25!]
  92.  -gNNN : turns number for population calculation (see below, default 30)
  93.  -sNN  : safetax limit for growth method taxation (default 3)
  94.  
  95.  
  96. Example :
  97.  
  98.  randgen GAME1 -d50 -t150 -o50 -n
  99.  
  100. will generate a NEW randmax.ini in the directory GAME1 and use a taxrate of 
  101. 150%.  It will also add a 'd50' command on every planet and use an 
  102. 'outmine' time of 50 turns (see below). 
  103.  
  104.  
  105. Note to the auto change :
  106.  
  107. RANDGEN will change section 2 entries in randmax.ini.  This is useful if 
  108. small meteors strike, natives appear and in several other cases.  Entries 
  109. in sections 1 and 3 are not changed.  For description of these sections see 
  110. randmax.doc. 
  111.  
  112. There is no update of the mines and factories for planets with valuable 
  113. natives (where factories are not maximized).  The only how these numbers 
  114. could change is through terraforming (with a different maximum native 
  115. limit), and auto update here would lead to an increase of the maximum 
  116. factory/mine number by 160-170 every turn which is exactly what we want to 
  117. avoid on such a planet :-) 
  118.  
  119. If you don't like this then turn it off with the -a switch.
  120.  
  121. If you want an update of all planets, even the ones with valuable natives, 
  122. then use the -f switch. 
  123.  
  124. If both -a and -f switches are specified then the first of them will be in 
  125. use. 
  126.  
  127.  
  128. PHOST and HOST v3.2
  129. ===================
  130.  
  131. There are some things you should keep in mind if you play with these 
  132. host versions. 
  133.  
  134. HOST has a 20% tax limit for Borg planets (except for Avians).  If you 
  135. tax higher than 20% the happiness will decrease normally but you get no 
  136. extra money.  Therefore RandGen inserts these limits into the third 
  137. section of RandMax.INI ("mnt 20" and "mct 20").  PHOST has no such limit 
  138. so you can delete these orders if you play Borg in a PHOSTed game. 
  139.  
  140. All HOST v3.2 versions (both HOST and PHOST) have a configurable maximum 
  141. income per planet.  Future RandMax versions will support this limit so 
  142. make sure that you add the appropriate line into the third section of 
  143. RandMax.INI. 
  144.  
  145. How does it work ?
  146. ==================
  147.  
  148. General
  149. ~~~~~~~
  150.  
  151. RANDGEN will scan your planet data and your RandMax.INI.  If it finds a 
  152. planet that has no special order (in the second section) then it will 
  153. generate a special order for this planet and add it to RandMax.INI. 
  154.  
  155. If you select the /n switch then randgen will rename an existing RandMax.INI
  156. to RandMax.BAK and generate a completely new RandMax.INI.
  157.  
  158. The special order for the planet depends on the mineral content and the 
  159. natives living on it.  RANDGEN will try to order enough mines to get the 
  160. minerals out of the planet core in a reasonable time but RANDGEN will 
  161. also be careful to build not too many mines in order to keep the natives 
  162. happy. 
  163.  
  164. The parameters
  165. ~~~~~~~~~~~~~~
  166.  
  167. Here is an explaination for the possible command line parameters.
  168.  
  169. MINETURNS  : RandGen will order enough mines to outmine the planet in 
  170.              MINETURNS turns.  Please note that usually the mineral with 
  171.              the lowest density determines the required number of mines 
  172.              so most minerals will be mined out a lot earlier (at least 
  173.              if you have enough colonists to build the required number 
  174.              of mines).  The default value is 30 turns.  You control 
  175.              MINETURNS with the /o switch. 
  176.  
  177. MINEINCOME : If your planet has valuable natives then you might want to 
  178.              build fewer mines in order to avoid making them upset.  If 
  179.              you get more tax at 1% taxrate than MINEINCOME then RANDGEN 
  180.              will reduce the number of mines.  Use the /r switch to 
  181.              change the default of 40 MC. 
  182.  
  183. NOFACT     : Usually it makes sense to maximize your factories because 
  184.              you will get more money if you build the factories and sell 
  185.              the supplies instead of taking the 1 or 2 percent more tax 
  186.              that you can get if you build no factories.  However, a few 
  187.              natives are valuable enough so that it's useful to build no 
  188.              factories at all. I call this limit NOFACT and the default 
  189.              value is 170 (because you have to go down 1% for every 170 
  190.              factories you build).  Change this value with the /i
  191.              switch. 
  192.  
  193. GROWTURNS  : Imagine you have a nice warm planet with few but good 
  194.              natives.  On the one hand you can let them grow for some 
  195.              turns.  After that growth period they may be over the 
  196.              MINEINCOME or NOFACT value and you want to build only few 
  197.              or no mines and factories.  On the other hand you may have 
  198.              only very few natives and they would take a very long time 
  199.              to grow to a number that justifies it to build few mines or 
  200.              factories.  So I decided to introduce the parameter that 
  201.              works like this :  I calculate the income per tax% (to 
  202.              compare it with MINEINCOME and NOFACT) for the population 
  203.              that you would get if you let your natives grow (0% tax) 
  204.              for GROWTURNS turns.  The default is 30 and you can change 
  205.              it with the /g switch. 
  206.  
  207. SAFETAX    : RandMax offers you to tax the natives with a growth method 
  208.              ("n") or at 'safetax' ("t", the highest possible tax rate 
  209.              without decreasing the native happiness).  If the safetax 
  210.              rate is low then you will lose a lot of money if you tax 
  211.              the natives with the growth method (a result of Tims 
  212.              rounding).  If you have a high safetax then the increased 
  213.              growth will make up very soon for the lost money.  The 
  214.              SAFETAX switch decides how to tax the natives : if the 
  215.              safetax rate is lower or equal to SAFETAX then RANDGEN will 
  216.              tell randmax to use safetax.  If the safetax rate is higher 
  217.              then RANDGEN will order randmax to use the growth method. 
  218.              The default value is 3, configurable with the /s switch. 
  219.  
  220. TAXRATE/MININGRATE 
  221.              Usually RandGen will assume the default tax rates and 
  222.              mining rates, i.e. 200% tax, 70% mining for Feds and 200% 
  223.              mining for Lizards.  If you select a different 
  224.              tax/miningrate you do not only change the rates, you also 
  225.              force randgen to use this value for all races. 
  226.  
  227.  
  228. Details
  229. ~~~~~~~
  230.  
  231. Here is how RANDGEN makes a special order for a certain planet : 
  232.  
  233. First RANDGEN figures out the number of mines that you need to get all 
  234. minerals out of the core in MINETURNS turns. 
  235.  
  236. If there are no natives living on the planet then RANDGEN will order 
  237. this number of mines plus maximum factories (even if you have 10 million 
  238. colonists it's still better to build factories because you need to 
  239. decrease the tax by 1 % for every 240 factories you build.  240 
  240. factories give you 240 MC but 10 million colonists give you just 100 MC 
  241. for 1% tax. 
  242.  
  243. (Note that the factory influence is different for natives and colonists.
  244. You need to reduce the native tax by 1% for every 170 mines or factories 
  245. instead of 240 for colonists.) 
  246.  
  247. If natives are living on the planet then RANDGEN will check if it is 
  248. worth to reduce the number of factories and mines (only if you are not 
  249. the Cyborg).  Keep in mind that you have to lower the taxrate by 1% for 
  250. every 170 factories or mines you build.  If you get 100 MC for every 
  251. percent tax then you lose 100 MC income per turn if you build 170 mines. 
  252. Once the planet is mined out you still lose the 100 MC per turn but get 
  253. nothing for it. 
  254.  
  255. So RANDGEN figures out how much money you will get for _1_ tax percent 
  256. if you let the natives grow for GROWTURNS turns.  I call this value the 
  257. INCOME. 
  258.  
  259. If the INCOME is higher than MINEINCOME then RANDGEN will reduce the 
  260. mines by the factor MINEINCOME/INCOME.  Additionally the maximum number 
  261. of mines is 200*MINEINCOME/INCOME.  So the more money you can get the 
  262. fewer mines RANDGEN will build.  However, if INCOME is lower than NOFACT 
  263. then RANDGEN will still order the maximum number of factories ("f"). 
  264.  
  265. If INCOME is even higher than NOFACT then RANDGEN will try to keep the 
  266. number of factories and mines as low as possible.  How low is 'as low as 
  267. possible'?  Well, everything depends on the rounding in Tim's formulas. 
  268. There is a number of mines and factories that you can build without 
  269. losing money ( = be forced to go down by 1%) but if you build just one 
  270. factory or mine more then you have to decrease the taxrate. 
  271.  
  272. RANDGEN calculates the possible population maximum (depending on the 
  273. climate) and figures out this number.  So you can take as much tax at 
  274. maximum population as if you have no mines and factories at all. If you 
  275. should have already more factories and mines than this number then 
  276. RANDGEN will calculate the number for the highest possible taxrate at 
  277. maximum population.  Since it doesn't matter if you build factories or 
  278. mines RANDGEN will split these number between the mines and factories 
  279. depending on existing structures and mineral content (low minerals cause 
  280. low mine numbers). 
  281.  
  282.  
  283. The mine and factory numbers are cut to the highest possible multiple of 
  284. 10 (to get nice looking planets :-). 
  285.  
  286. After that RANDGEN decides how to tax natives :
  287.  
  288. If you have a high safetax value (the tax rate at which the happiness 
  289. remains constant) then it's better to tax the natives with the growth 
  290. method ("n").  If you have a low safetax (<4) then it is more useful to 
  291. tax at safetax ("t") because you will lose a lot of money if you tax the 
  292. natives with the growth method (also a result of Tims rounding).  BTW 
  293. RANDGEN will tax Boviniods always with the 'growth' - method. 
  294.  
  295. RANDGEN won't let the natives grow on Cyborg planets, it will always try 
  296. to get as much money out of them as possible ('t40'). 
  297.  
  298. Notes
  299. =====
  300.  
  301.  - If no -n switch is given then randgen will keep the first and third 
  302.    section in the existing randmax.ini. 
  303.  
  304.  - RandGen will always change existing special orders, EXCEPT orders 
  305.    where a number follows the factory build order (f???).  This is 
  306.    because these numbers won't be changed anyway and if you terraform 
  307.    you'll hurt your income by building more factories and mines than 
  308.    necessary if such an order is changed. 
  309.  
  310.  - defense doesn't influence the happiness of natives and colonists
  311.  
  312. Related Formulas
  313. ================
  314.  
  315. Maximum mines/factories/defense
  316. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317. maxmines     = 200+sqrt(clans-200)   (or number of clans if clans<200)
  318. maxfactories = 100+sqrt(clans-100)   (or number of clans if clans<100)
  319. maxdefense   =  50+sqrt(clans-50)    (or number of clans if clans<50)
  320.  
  321.  
  322. Maximum population 
  323. ~~~~~~~~~~~~~~~~~~
  324. maxcolonists = 10,000,000*sin(temperature*pi/100)
  325. maxcolonists = 10,000,000*(temp/100) (only Crystals with 'Crystals like desert')
  326. maxnatives   = 15,600,000*sin(temperature*pi/100) (approx)
  327.  
  328.  
  329. Growth
  330. ~~~~~~
  331. I figured them out with host314. These formulas were different with host300f,
  332. so if you use an older host version you will get a different growth.
  333.  
  334. Colonist_Growth%=5*sin(temperature*pi/100)/(1+tax_rate/5) 
  335. The growth is cut to 0 if
  336. (a) the happiness is lower than 70
  337. (b) the temperature is arctic or desert (<16 or >84)
  338. (c) the maximum population would be exceeded at the current growth rate
  339.     
  340. Native_Growth%=4*sin(temperature*pi/100)/(1+tax_rate/5)
  341. The growth is cut to 0 if
  342. (a) the happiness is lower than 70
  343. (b) the maximum population would be exceeded at the current growth rate
  344.  
  345. If you play the Crystallines and the 'crystals like desert' switch is on you
  346. will get different growth rates for your colonists :
  347. growth%=(temperature/20)/(1+tax_rate/5)
  348.  
  349.  
  350. Happiness
  351. ~~~~~~~~~
  352. Natives :
  353. happy_change=trunc(5+native_government/2-sqrt(natives/1.000.000)
  354.                     - (mines+factories)/200 - tax*.85)
  355. Colonists :
  356. happy_change=trunc(10-sqrt(colonists/1.000.000)-(mines+factories)/300
  357.                     - tax*.8 - abs(temp-50)/33)
  358.  
  359.  
  360. Disclaimer of warranties
  361. ========================
  362. RANDGEN is not warranted in any way.  If you use it you use it at your 
  363. own risk.  The author is not liable for any damage or loss of data that 
  364. may occur during regular usage of RANDGEN. 
  365.  
  366.  
  367.  
  368. Author's note
  369. =============
  370.  
  371. If you have suggestions or if you find bugs then please contact me via 
  372. email : 
  373.  
  374.  spock@berlin.snafu.de (preferred)
  375.  voigtgob@cs.tu-berlin.de (if you can't reach me at snafu)
  376.  
  377.  
  378. You can reach the author of RANDMAX, Steffen Pietsch, at :
  379.  
  380.  neffets@cs.tu-berlin.de
  381.  
  382.  
  383. Thomas Voigt
  384.  
  385.                         ---------- *** ----------
  386.  
  387.